home *** CD-ROM | disk | FTP | other *** search
/ Family Forum 261 / SOMC Family Forum 261.iso / Xtras / Behavior Library.cst / 00047_Script_UI Rollover and Mouse Down Pointer Change < prev    next >
Text File  |  1997-11-17  |  4KB  |  60 lines

  1. -- Pointer Rollover and Mouse Down, Up
  2.  
  3.  
  4. -- behavior library version 1.1
  5. -- a control
  6. -- Changes the cursor when the cursor rollsover the sprite
  7. property outcurs, incurs, incursSet, customImage, customMask, customDownImage, customDownMask
  8. property incursDownSet, oldcursor
  9. property useCustom, useCustomDown
  10.  
  11. on translate_cursor me, setting, image, mask, custom
  12.   if custom then
  13.     set val = [ member image, member mask ]
  14.     return val
  15.   end if
  16.   return setting
  17. end
  18.  
  19.  
  20. --- 
  21.  
  22.  
  23. on beginSprite me
  24.   set oldcursor = the cursor of sprite the spritenum of me
  25.   set val =  translate_cursor( me, the incursSet of me, customImage, customMask, useCustom )
  26.   set the cursor of sprite the spriteNum of me = val
  27.   
  28. end
  29.  
  30. on endsprite me
  31.   set the cursor of sprite the spriteNum of me = oldcursor
  32. end
  33.  
  34. on mousedown me
  35.   set val =  translate_cursor( me, the incursDownSet of me, customDownImage, customDownMask, useCustomDown )
  36.   set the cursor of sprite the spriteNum of me = val
  37. end  
  38. on mouseupOutside me
  39.   set val =  translate_cursor( me, the incursSet of me, customImage, customMask, useCustom )
  40.   set the cursor of sprite the spriteNum of me = val
  41. end
  42. on mouseup me
  43.   set val =  translate_cursor( me, the incursSet of me, customImage, customMask, useCustom )
  44.   set the cursor of sprite the spriteNum of me = val
  45. end
  46.  
  47. on getPropertyDescriptionList
  48.   
  49.   set p_list = [      #incursSet: [ #comment:   "Rollover Pointer Image:",                     #format:   #cursor,                     #default:   1 ],        #useCustom: [ #comment: "Use Custom Pointer:",                     #format:   #boolean,                    #default:    FALSE ],   #customImage: [ #comment:   "Custom Image:",                     #format:   #bitmap,                    #default:    member 1 ],     #customMask: [ #comment:   "Custom Mask:",                     #format:   #bitmap,                    #default:    member 1 ],      #incursDownSet: [ #comment:   "Mouse Down Pointer Image:",                     #format:   #cursor,                    #default:   1],        #useCustomDown: [ #comment: "Use Custom Pointer When Mouse Down:",                     #format:   #boolean,                    #default:    FALSE ],   #customDownImage: [ #comment:   "Custom Down Image:",                     #format:   #bitmap,                    #default:    member 1 ],     #customDownMask: [ #comment:   "Custom Down Mask:",                     #format:   #bitmap,                    #default:    member 1 ]   ]
  50.   return p_list 
  51.   
  52. end
  53.  
  54.  
  55. on getBehaviorDescription
  56.   return "Makes the pointer image change when the pointer is over the current sprite, also defines a different pointer image to display when the sprite is clicked. Choose any of the pointers included with Director or a 1-bit bitmapped cast member." & RETURN & "PARAMETERS:" & RETURN & "ò Rollover Pointer Image - Choose the pointer image to appear when the pointer rolls over the sprite. Select one of Director's included pointers."  & RETURN & "ò Use Custom Pointer - Turn this option on to specify a cast member instead of an included pointer." & RETURN & "ò Custom Image  - ( optional ) Choose a cast member to use as the pointer image.  This choice is ignored unless Use Custom Pointer is on."  & RETURN & "ò Custom Mask - ( optional ) Choose a cast member to use as a mask image.  "&RETURN&"ò Mouse Down Pointer Image - Choose one of Director's included pointers to be displayed when the mouse is down."  & RETURN & "ò Use Custom Pointer When Mouse Down - Turn this option on to specify a cast member as the mouse down pointer instead of one of Director's included pointers."  & RETURN & "ò Custom Down Image  - ( optional ) Choose a cast member to use as a pointer image when the mouse is down.  This setting is ignored unless Use Custom Pointer When Mouse Down is on."  & RETURN & "ò Custom Down Mask - ( optional ) Choose a cast member to use as a mask image when mouse is down."
  57.   
  58. end
  59.  
  60.